#include "StdAfx.h"
#include "brubber.h"
#include "btime.h"		//for port info
#include "machine/BurninRubberMachine.h"

static dip_t dip1[] =
	{
	{"Coin 1",2,3,{{"2 coins/1 credit",0},{"1 coin/3 credits",1},{"1 coin/2 credits",2},{"1 coin/1 credit",3}}},
	{"Coin 2",2,0x0C,{{"2 coins/1 credit",0},{"1 coin/3 credits",4},{"1 coin/2 credits",8},{"1 coin/1 credit",0xC}}},
	{"Service",1,0x10,{{"on",0},{"off",0x10}}},
	{"Unknown",1,0,{{"off",0},{"on",0x20}}},
	{"Cabinet type",1,0,{{"upright",0},{"cocktail",0x40}}},
	{"VBlank",-1,0,{{"off",0},{"on",0x80}}},
	{0,0,0,0,0}	
	};

static dip_t dip2[] =
	{
	{"Lives",1,1,{{"5",0},{"3",1}}},
	{"Bonus life",2,6,{{"30,000",0},{"20,000",2},{"every 70,000",4},{"every 30,000",6}}},
	{"Continue",1,8,{{"yes",0},{"no",8}}},
	{"Difficulty",1,0x10,{{"hard",0},{"easy",0x10}}},
	{"Unknown",1,0,{{"off",0},{"on",0x20}}},
	{"Unknown",1,0,{{"off",0},{"on",0x40}}},
	{"Unknown",1,0,{{"off",0},{"on",0x80}}},
	{0,0,0,0,0}	
	};

static InputPort Port3 =
	{
		{
		{"Tilt",		I_TILT,		0x01,	I_LOW},
		{"Unknown",	0,				0x02,	I_LOW},
		{"Unknown",	0,				0x04,	I_LOW},
		{"Start 1",	I_START1,	0x08,	I_LOW},
		{"Start 2",	I_START2,	0x10,	I_LOW},
		{"Unknown",	0,				0x20,	I_LOW},
		{"Coin 1",	I_COIN1,		0x40,	I_LOW | I_CPU_NMI(0)},
		{"Coin 2",	I_COIN2,		0x80,	I_LOW | I_CPU_NMI(0)},
		}
	};

static highscore_t highscore[] =
	{
	{0x000A,3,0x12,0x01},
	{0x0500,0x26C,0x01,0x00},
	{0x0640,1,0x4D,0x4D},
	{0,-1}
	};

Cbrubber::Cbrubber()
{
SetName("brubber");
SetScreen(256,256,ROTATE_270);
SetHighScoreInfo(highscore);
SetDip(0,dip1);
SetDip(1,dip2);
SetPort(0,&btimePort1);
SetPort(1,&btimePort2);
SetPort(2,&Port3);
AddROM("brubber.12c",0xC000,0x2000,0xb5279c70,ROM_CPU1);
AddROM("brubber.12d",0xE000,0x2000,0xb2ce51f5,ROM_CPU1);
AddROM("bnj6c.bin",	0xF000,0x1000,0x8c02f662,ROM_CPU2);
AddROM("bnj4e.bin",	0x0000,0x2000,0xb864d082,ROM_VROM1);
AddROM("bnj4f.bin",	0x2000,0x2000,0x6c31d77a,ROM_VROM1);
AddROM("bnj4h.bin",	0x4000,0x2000,0x5824e6fb,ROM_VROM1);
AddROM("bnj10e.bin",	0x0000,0x1000,0xf4e9eb49,ROM_VROM2);
AddROM("bnj10f.bin",	0x1000,0x1000,0xa9ffacb4,ROM_VROM2);
}

CMachine *Cbrubber::CreateMachine()
{
return(new CBurninRubberMachine());
}
